package com.happy_hao.topbiz.api;

import com.happy_hao.topbiz.common.Result;
import com.happy_hao.topbiz.dto.msgDto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;



@FeignClient(name = "msg",path = "/msg")
public interface MsgApi {

    @PostMapping("/email/instantSend")
    public Result instantSend( @RequestBody EmailRequest emailRequest);

    @PutMapping("/email/newScheduledSend")
    public Result newScheduledSend( @RequestBody EmailRequest emailRequest) ;

    // 启动周期性发送
    @PostMapping("/email/periodicSend")
    public Result periodicSend(@RequestBody  PeriodicSendRequest periodicSendRequest);

    // 停止周期性发送
    @GetMapping("/email/stopPeriodicSend/{taskId}")
    public ResponseEntity<String> stopPeriodicSend(@PathVariable String taskId) ;

    //非周期性发送
    @PostMapping("/email/noPeriodStart")
    public ResponseEntity<String> noPeriodStart(@RequestBody  NoPeriodStartRequest noPeriodStartRequest) ;
    //取消非周期性发送
    @GetMapping("/email/noPeriodsTop/{taskId}")
    public ResponseEntity<String> noPeriodsTop(@PathVariable String taskId) ;

    @PostMapping("/email/systemInfo")
    public Result systemInfo(@RequestBody SystemInfoRequest systemInfoRequest);

    @PutMapping("/sender/addSender")
    public Result addSender( @RequestBody SenderRequest senderRequest);

    @GetMapping("/sender/getAllSenders")
    public Result getAllSenders();

    @DeleteMapping("/sender/deleteSender")
    public Result deleteSender(@RequestParam("username") String username);

    @PostMapping("/sender/updateSender")
    public Result updateSender( @RequestBody SenderRequest senderRequest);

    @PutMapping("/template/addTemplate")
    public Result addTemplate( @RequestBody TemplateRequest templateRequest);

    @GetMapping("/template/getAllTemplate")
    public Result getAllTemplate();

    @DeleteMapping("/template/deleteTemplate")
    public Result deleteTemplate(@RequestParam("title") String title);

    @RequestMapping("/template/updateTemplate")
    public Result updateTemplate(@RequestBody TemplateRequest templateRequest);

}
